package com.aspose.cells;

import java.util.ArrayList;
import java.util.Iterator;

public class GroupBox extends Shape {
   GroupBox(ShapeCollection shapes) {
      super(shapes, 19, shapes);
      this.w = new zbtz(this);
   }

   public boolean getShadow() {
      return this.z;
   }

   public void setShadow(boolean value) {
      this.z = value;
   }

   ArrayList a() {
      ArrayList var1 = new ArrayList();
      int var2 = this.getPlacement();
      this.setPlacement(2);
      int var3 = this.getUpperLeftRow();
      int var4 = this.getTop();
      int var5 = this.getUpperLeftColumn();
      int var6 = this.getLeft();
      int var7 = this.getLowerRightRow();
      int var8 = this.getBottom();
      int var9 = this.getLowerRightColumn();
      int var10 = this.getRight();
      this.setPlacement(var2);
      int var11 = -1;
      int var12 = -1;
      int var13 = -1;
      int var14 = -1;
      Iterator var15 = this.J().iterator();

      while(true) {
         Shape var16;
         do {
            do {
               if (!var15.hasNext()) {
                  return var1;
               }

               var16 = (Shape)var15.next();
            } while(var16 == this);
         } while(var16.S());

         boolean var17 = false;
         int var18;
         int var19;
         int var20;
         int var21;
         switch(var16.getPlacement()) {
         case 0:
            if (var11 == -1) {
               var11 = this.getTopToCorner();
               var12 = this.getLeftToCorner();
               var13 = var12 + this.getWidth();
               var14 = var11 + this.getHeight();
            }

            var18 = var16.getTopToCorner();
            var19 = var16.getLeftToCorner();
            var20 = var19 + var16.getWidth();
            var21 = var18 + var16.getHeight();
            if (var18 >= var11 && var21 <= var14 && var19 >= var12 && var20 <= var13) {
               var17 = true;
            }
            break;
         case 1:
         case 2:
            var18 = var16.getUpperLeftRow();
            var19 = var16.getTop();
            var20 = var16.getUpperLeftColumn();
            var21 = var16.getLeft();
            if ((var18 > var3 || var18 == var3 && var19 >= var4) && (var20 > var5 || var20 == var5 && var21 >= var6)) {
               var2 = var16.getPlacement();
               var16.setPlacement(2);
               int var22 = var16.getLowerRightRow();
               int var23 = var16.getBottom();
               int var24 = var16.getLowerRightColumn();
               int var25 = var16.getRight();
               if ((var22 < var7 || var22 == var7 && var23 <= var8) && (var24 < var9 || var24 == var9 && var25 <= var10)) {
                  var17 = true;
               }

               var16.setPlacement(var2);
            }
         }

         if (var17) {
            com.aspose.cells.b.a.a.ze.a(var1, (Object)var16);
            if (var16.isGroup()) {
               com.aspose.cells.b.a.a.ze.b(var1, ((GroupShape)var16).getGroupedShapes());
            }
         }
      }
   }

   void a(GroupBox var1, CopyOptions var2) {
      super.a((Shape)var1, (CopyOptions)var2);
   }
}
